﻿using Microsoft.AspNet.SignalR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;

namespace huaxin_luckdraw.Hubs
{
    /// <summary>
    /// 订单处理
    /// </summary>
    public class OrderHub : Hub
    {

        /// <summary>
        /// 判断该用户是否支付订单
        /// </summary>
        /// <param name="orderId"></param>
        public void getOrderNoHandle(string orderId)
        {

            //if (string.IsNullOrEmpty(orderId))
            //    return;

            //var connId = Context.ConnectionId;

            //var jsonObj = OrderHubHelp.GetOrderResult(orderId);

            //Clients.Client(connId).sendOrderNoResult(jsonObj);
            if (!SessionTimer.Timers.ContainsKey(Context.ConnectionId))
            {
                SessionTimer.StartTimer(Context.ConnectionId,orderId);
            }
        }


        public override Task OnDisconnected(bool stopCalled)
        {
            SessionTimer.StopTimer(Context.ConnectionId);
            return base.OnDisconnected(stopCalled);
        }


    }
}